<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        显示时间戳
        <ul>
            <li v-for='item in timearr'>{{item}}</li>
        </ul>
        显示日期时间
        <ul>
            <li v-for="item in timearr">{{item | format}}</li>
        </ul>

    </div>
    <script>
        var app =new Vue({
            el:"#app",
            data:{
                timearr: ['1579657789851', '1563516693000', '1578539380000']
            },
            filters: {
                format:function(time){
                    var d =new Date(parseInt(time));
                    console.log(d);
                    return d.getFullYear()+'年'+(d.getMonth()+1)+"月"+d.getDate()+"日"+d.getHours()+"时" + d.getMinutes()+'分' + d.getSeconds() + '秒'
                }
            }
        })
    </script>
    
</body>
</html>